package com.aop.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(2)
@Aspect
@Component
public class MyAnnotationAspect {
    @Pointcut("@annotation(com.validate.annotation.MyValidate)")
    public void annotation() {
    }

    @Before("annotation()")
    public void beforeMethod(JoinPoint joinPoint) {
        String className = joinPoint.getSignature().getDeclaringTypeName();
        String methodName = joinPoint.getSignature().getName();
        System.out.println(className);
        System.out.println(methodName);
    }

}
